﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleMenuRight.aspx.cs" Inherits="UI.ModSystem.RoleMenuRight" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
 <link rel="stylesheet" type="text/css" href="../Styles/BaseStyle.css" />
  <script type="text/javascript">
      function public_GetParentByTagName(element, tagName) {
          var parent = element.parentNode;
          var upperTagName = tagName.toUpperCase();
          while (parent && (parent.tagName.toUpperCase() != upperTagName)) {
              parent = parent.parentNode ? parent.parentNode : parent.parentElement;
          }
          return parent;
      }

      function setParentChecked(objNode) {
          var objParentDiv = public_GetParentByTagName(objNode, "div");
          if (objParentDiv == null || objParentDiv == "undefined") {
              return;
          }
          var objID = objParentDiv.getAttribute("ID");
          objID = objID.substring(0, objID.indexOf("Nodes"));
          objID = objID + "CheckBox";
          var objParentCheckBox = document.getElementById(objID);
          if (objParentCheckBox == null || objParentCheckBox == "undefined") {
              return;
          }
          if (objParentCheckBox.tagName != "INPUT" && objParentCheckBox.type == "checkbox")
              return;
          objParentCheckBox.checked = true;
          setParentChecked(objParentCheckBox);
      }

      function setChildUnChecked(divID) {
          var objchild = divID.children;
          var count = objchild.length;
          for (var i = 0; i < objchild.length; i++) {
              var tempObj = objchild[i];
              if (tempObj.tagName == "INPUT" && tempObj.type == "checkbox") {
                  tempObj.checked = false;
              }
              setChildUnChecked(tempObj);
          }
      }

      function setChildChecked(divID) {
          var objchild = divID.children;
          var count = objchild.length;
          for (var i = 0; i < objchild.length; i++) {
              var tempObj = objchild[i];
              if (tempObj.tagName == "INPUT" && tempObj.type == "checkbox") {
                  tempObj.checked = true;
              }
              setChildChecked(tempObj);
          }
      }

      //触发事件
      function CheckEvent() {

          var objNode = event.srcElement;

          if (objNode.tagName != "INPUT" || objNode.type != "checkbox")
              return;

          if (objNode.checked == true) {
             // setParentChecked(objNode);
              var objID = objNode.getAttribute("ID");
                  objID = objID.substring(0, objID.indexOf("CheckBox"));
              var objParentDiv = document.getElementById(objID + "Nodes");
              if (objParentDiv == null || objParentDiv == "undefined") {
                  return;
              }
              setChildChecked(objParentDiv);
          }
          else {
                objID = objNode.getAttribute("ID");
                objID = objID.substring(0, objID.indexOf("CheckBox"));
                objParentDiv = document.getElementById(objID + "Nodes");
              if (objParentDiv == null || objParentDiv == "undefined") {
                  return;
              }
              setChildUnChecked(objParentDiv);
          }
      }

</script>
</head>
<body>
    <form id="form1" runat="server">
    <table class="pagetop">
        <tr class="td">
            <td>
                <div class="pagetopleft">
                    菜单权限设置</div>
            </td>
            <td>
                <div class="pagetopright">
              </div>
            </td>
        </tr>
    </table>
   
    <div id="divSet" style="margin-left:80px" >
       <asp:TreeView ID="MainMenuTreeView" runat="server" ShowCheckBoxes="All" 
                        ExpandDepth="0" >
                    </asp:TreeView>
   
    <asp:Panel ID="Panel1" runat="server" >
    <br />
    功能权限：<br />
        <asp:CheckBox ID="cbAdd" runat="server" Text="增加" />
        <asp:CheckBox ID="cbDel" runat="server" Text="删除" />
        <asp:CheckBox ID="cbMod" runat="server" Text="修改" />
        <asp:CheckBox ID="cbSer" runat="server" Text="查询" />
        <asp:CheckBox ID="cbIn" runat="server" Text="导入" />
        <asp:CheckBox ID="cbOut" runat="server" Text="导出" />
        <asp:CheckBox ID="cbPrint" runat="server" Text="打印" />
        <asp:CheckBox ID="cbCheck" runat="server" Text="审核" />
         <asp:CheckBox ID="cbCancelCheck" runat="server" Text="反审核" />
        <asp:CheckBox ID="cbApprove" runat="server" Text="审批" />
        <asp:CheckBox ID="cbCancelApprove" runat="server" Text="反审批" />
        <asp:CheckBox ID="cbFei" runat="server" Text="作废" />
        <asp:CheckBox ID="cbCancelFei" runat="server" Text="反作废" />
        <asp:CheckBox ID="cbSet" runat="server" Text="设置" />
      
        <br /><br />
        范围权限：
        <asp:RadioButtonList ID="rbRange" runat="server" RepeatDirection="Horizontal">
            <asp:ListItem Selected="True" Value="1">普通</asp:ListItem>
            <asp:ListItem Value="2">部门</asp:ListItem>
            <asp:ListItem Value="2">公司</asp:ListItem>
            <asp:ListItem Value="4">集团</asp:ListItem>
            <asp:ListItem Value="5">超级用户</asp:ListItem>
            <asp:ListItem Value="6">限制用户</asp:ListItem>
            <asp:ListItem Value="7">Guest</asp:ListItem>
        </asp:RadioButtonList>
        <br />  <br />
        <asp:Button ID="btnConfig" runat="server" CssClass="ButtonCss" 
            OnClick="btnConfig_Click" Text="设置权限" />
        &nbsp;<asp:Button ID="btnBack" runat="server" CssClass="ButtonCss" 
            OnClick="btnBack_Click" Text="返回" />
    </asp:Panel>
     </div>
    </form>
</body>
</html>
